package com.example.a18990144;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity implements View.OnClickListener{
    private TextView tv_maquee;
    private boolean isPaused = false;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        tv_maquee = findViewById(R.id.tv_marquee);
        tv_maquee.setOnClickListener(this);
        tv_maquee.requestFocus();
    }
    public void onClick(View v){
        if(v.getId()==R.id.tv_marquee){
            isPaused = !isPaused;
            if(isPaused){
                tv_maquee.setFocusable(false);
                tv_maquee.setFocusableInTouchMode(false);
            } else{
                tv_maquee.setFocusableInTouchMode(true);
                tv_maquee.setFocusableInTouchMode(true);
                tv_maquee.requestFocus();
            }
        }
    }
}